<template>
  <div class="status-main">
    <div class="status-top">
      <div class="left">
        <img src="../assets/images/logo.png" alt="" />
      </div>
      <div class="right" @click="exit">
        <img :src="imgsrc" alt="" /><span v-if="imgsrc">退出</span>
      </div>
    </div>
    <div class="status-middle">
      <router-view></router-view>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      imgsrc: "",
    };
  },
  created() {
    this.imgsrc = this.$route.meta.nologin
      ? ""
      : require("../assets/images/switch.png");
  },
  methods: {
    exit() {
      sessionStorage.removeItem("detail");
      this.$router.push("/login");
    },
  },
};
</script>
<style lang="less" scoped>
.status-main {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  .status-top {
    height: 72px;
    background: linear-gradient(270deg, #4d5053 0%, #232324 100%);
    opacity: 0.9;
    display: flex;
    justify-content: space-between;
    .left {
      color: #fff;
      font-size: 24px;
      line-height: 72px;
      img {
        margin-left: 30px;
        margin-top: -4px;
      }
    }
    .right {
      line-height: 72px;
      color: #fff;
      margin-right: 30px;
      img {
        width: 26px;
        height: 26px;
        margin-right: 8px;
      }
      &:hover {
        cursor: pointer !important;
      }
    }
  }
  .status-middle {
    flex: 1;
    background-color: #edf5f8;
  }
}
</style>
